args <- commandArgs(trailingOnly=TRUE)
setwd(args[1])
library(affy)
eset <- justRMA()
write.exprs(eset,"rma.txt",sep="\t", quote=F)
data<-read.table("rma.txt",sep="\t",head=T)
rownames(data)<-data[,1]
data<-data[,2:ncol(data)]
#reading the negative id.s
ids<-read.table("/data4/bsi/bioinf_ext1/s113890.senescence/Potential_Negative_converted_ids.txt",sep="\t",head=T)
nega <-data[intersect(as.vector(tolower(ids[,2])), as.vector(tolower(rownames(data)))),]
#reading the positiveid.s
ids<-read.table("/data4/bsi/bioinf_ext1/s113890.senescence/Potential_Positive_converted_ids.txt",sep="\t",head=T)
posi <- data[intersect(as.vector(tolower(ids[,2])), as.vector(tolower(rownames(data)))),]
write.table(nega, "negative.txt", sep="\t", quote=F)
write.table(posi, "positive.txt", sep="\t", quote=F)
